# coding=utf-8
"""
Author: Mr.夏末
@Function: 零散知识点应用
"""

# 什么时候200不等于200
import json
import jsonpath

import requests

print(str(200) == 200)


def get_last_not_None_index(l):
    """获取列表最后一个不为空的下标"""
    for j in range(len(l) - 1, -1, -1):
        if l[j]:
            return j

# 从最后一个位置截取
l = ['', '', '查询', 'get', '',
     'app=weather.today&weaid=1&appkey=10003&sign=b59bc3ef6191eb9f747dd4e83c99f2a4&format=json', '', '', '']
i = get_last_not_None_index(l)
print(i)

# 天气接口
res = requests.get(
    "http://api.k780.com?app=weather.today&weaid=1&appkey=10003&sign=b59bc3ef6191eb9f747dd4e83c99f2a4&format=json")
print(res.text)
